//
//  MessageViewController.m
//  07-UITabBarControllerHomeWork
//
//  Created by 曹曹 on 16/7/22.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "MessageViewController.h"
#import "LabelButton.h"
#import "RegisterViewController.h"

#define SCREEN_WIDTH self.view.frame.size.width

@interface MessageViewController ()

@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"news"]];
    imageView.frame = self.view.frame;
    [self.view addSubview:imageView];
    [self createRegisterButton];
}

- (void)createRegisterButton {
    LabelButton *registerButton = [[LabelButton alloc] initWithFrame: CGRectMake(0, 0, 150, 44)
                                                               title:@"现在注册拉勾"
                                                     backgroundColor:[UIColor colorWithRed:0.01 green:0.81 blue:0.53 alpha:1.00]
                                                           textColor:[UIColor whiteColor]
                                                              target:self
                                                              action:@selector(GoRegister:)];
    registerButton.layer.cornerRadius = 5;
    registerButton.layer.masksToBounds = YES;
    registerButton.center = CGPointMake(SCREEN_WIDTH / 2, 400);
    LabelButton *loginButton = [[LabelButton alloc] initWithFrame: CGRectMake(0, 0, 150, 44)
                                                               title:@"登录"
                                                     backgroundColor:[UIColor colorWithRed:0.01 green:0.64 blue:0.49 alpha:0.2]
                                                           textColor:[UIColor colorWithRed:0.01 green:0.81 blue:0.53 alpha:1.00]
                                                              target:self
                                                              action:@selector(GoLogin:)];
    loginButton.layer.borderWidth = 1;
    loginButton.layer.borderColor = [UIColor colorWithRed:0.01 green:0.64 blue:0.49 alpha:0.2].CGColor;
    loginButton.layer.cornerRadius = 5;
    loginButton.layer.masksToBounds = YES;
    loginButton.center = CGPointMake(SCREEN_WIDTH / 2, 464);
    [self.view addSubview:registerButton];
    [self.view addSubview:loginButton];
}

- (void)GoRegister:(LabelButton *)button {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)GoLogin:(LabelButton *)button {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
